{% extends "layout.html" %}

{% block content %}
        <div class="container">
            <div>
              <div class="panel panel-default">
                <div class="panel-heading">
                  <h3 class="panel-title">
                    <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
                    新建用户ModelForm
                  </h3>
                </div>
                <div class="panel-body">

                  <form method="POST" novalidate>
                    {% csrf_token %}
                    {% for field in form %}
                    <div class="form-group">
                      <label>{{field.label}}</label>
                      {{field}}
                      <span style="color: red;">{{field.errors.0}}</span>
                      <!-- <input type="text" class="form-control" name="title" placeholder="标题"> -->
                    </div>
                    {% endfor %}


                    <button type="submit" class="btn btn-primary">提交</button>
                  </form>
                  
                </div>
              </div>


            </div>


        </div>
{% endblock %}

{% block js %}
          <script>
            $(function(){
                $('#id_create_time').datepicker({
                    formate:'yyyy-mm-dd',
                    startDate:'0',
                    language:"zh-CN",
                    autoclose:true
                })           
            })
            // 工具提示，鼠标放在button上有提示，
            $(function () {
                $('[data-toggle="tooltip"]').tooltip()
                })
            // 弹出框：前面的标签要加一个id=“example", 实现点标签时有旁边有弹出框显示内容
            $('#example').popover('show')
          </script>
{% endblock %}